﻿using Microsoft.Extensions.DependencyInjection;

namespace Amber.Arch.Catty
{
    public static class LifeTimeExtensions
    {
        public static LifeTime AsCatLifeTime(this ServiceLifetime lifetime) => lifetime switch
        {
            ServiceLifetime.Scoped => LifeTime.Self,
            ServiceLifetime.Singleton => LifeTime.Root,
            _ => LifeTime.Transient,
        };
    }
}
